/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package db.dbTables;

import core.objects.BaseObject;
import java.sql.ResultSet;
import java.sql.Types;
import java.util.ArrayList;
import java.util.List;

import db.queries.core.QueriesEnvironment;

public class BookCrossAuthorTable extends AbstractCrossDBTable {

    public static final String COLUMN_ID = "book_author_id";
    public static final String COLUMN_BOOK_ID = "book_id";
    public static final String COLUMN_AUTHOR_ID = "author_id";
    final public DbColumn id = new DbColumn(COLUMN_ID, Types.INTEGER, 11, false, this);
    final public DbColumn bookId = new DbColumn(COLUMN_BOOK_ID, Types.INTEGER, 11, false, this);
    final public DbColumn authorId = new DbColumn(COLUMN_AUTHOR_ID, Types.INTEGER, 11, true, this);

    public BookCrossAuthorTable() {
        super("book_cross_author", 
        		QueriesEnvironment.getBookTable(),
        		QueriesEnvironment.getAuthorTable());
        setIDColumn(id);
        setTable1IDColumn(bookId);
        setTable2IDColumn(authorId);
    }

    @Override
    public List<DbColumn> getDbColumns() {
        List<DbColumn> list = new ArrayList<DbColumn>();
        list.add(id);
        list.add(bookId);
        list.add(authorId);
        return list;
    }

    @Override
    public BaseObject convertSqlTableToBaseObject(ResultSet resultSet) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }
}
